package study03;
import java.util.Scanner;

/**
* @author GZQ
* @Date 2023/11/5
 */

public class Switch3 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入第一个数字：");
        int a = input.nextInt();
        System.out.println("请输入第二个数字：");
        int b = input.nextInt();
        System.out.println("请输入运算符：");
        char ch1 = input.next().charAt(0);
        int result;
        switch (ch1){
            case '+':
                result = a + b;
                System.out.println("计算结果是："+ "\n" + result);
                break;
            case '-':
                result = a - b;
                System.out.println("计算结果是："+ "\n" + result);
                break;
            case '/':
                result = a / b;
                System.out.println("计算结果是："+ "\n" + result);
                break;
            case '*':
                result = a * b;
                System.out.println("计算结果是："+ "\n" + result);
                break;
            default:
                System.out.println("输入的符号不正确");
        }
    }
}
